import React from "react"
class Input extends React.Component {
    state = {
        val: '请输入用户名',
        sel: '1'
    }
    handleClick = (e) => {
        this.setState({
            val: e.target.value
        })
        console.log(e.target.value)
    }
    handleChange = (e) => {
        this.setState({
            sel: e.target.value
        })
    }
    render() {
        return (
            <fieldset>
                <legend>受控组件</legend>
                <a onClick={(e) => { e.preventDefault() }} href="https:chst.vip">点击</a>
                <input type="text" value={this.state.val} onChange={this.handleClick} />
                <select value={this.state.sel} onChange={this.handleChange}>
                    <option value="1">士兵突击1</option>
                    <option value="2">士兵突击2</option>
                    <option value="3">士兵突击3</option>
                    <option value="4">士兵突击4</option>
                    <option value="5">士兵突击5</option>
                    <option value="6">士兵突击6</option>
                    <option value="7">士兵突击7</option>
                </select>
            </fieldset>
        )
    }
}
export default Input